<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * 生成报表
 */
class Rander_report extends CI_Controller{

	private $time_of_rander;
	private $time_of_rander_format;
	private $interval;

	public function __construct(){
	/*{{{*/
		parent::__construct();
		$this->load->library( 'user_auth' ); 

		if( $this->user_auth->is_login() ){

			//已经登录系统
			//得到用户的信息
			$user = $this->session->userdata( 'user' );
			$user_obj = unserialize( $user['user_obj'] );

			$this->subject_user_info = $user_obj->get();
		}else{

			$this->subject_user_info = array();
		 }
	}/*}}}*/

	/**
	 * 从远端服务器获取相应报表服务的信息
	 *
	 * @param string $type 指定服务
	 */
	private function get_info( $class , $method , $interval = '' ){
	/*{{{*/
		$this->config->load( 'oauth2' );
		$this->load->library( 'oauth_client' );

		$server_base_uri = $this->config->item( 'server_base_uri' );
		//报表间隔
		//@todo 可以考虑移到构造函数中去
		if( !empty( $interval ) ){

			$this->interval = $interval;
		
			$interval_sec = ( $interval * 24 * 60 * 60 );

			$this->time_of_begin = $_SERVER['REQUEST_TIME'] - $interval_sec;
			$this->time_of_begin_format = date( 'Y-m-d' , $this->time_of_begin );

			$this->time_of_rander = $_SERVER['REQUEST_TIME'];
			$this->time_of_rander_format = date( 'Y-m-d' , $_SERVER['REQUEST_TIME'] );

			$this->next_time_of_rander = $_SERVER['REQUEST_TIME'] + $interval_sec;
			$this->next_time_of_rander = date( 'Y-m-d' , $this->next_time_of_rander );

			$request_uri = $server_base_uri .
			       	"/api/$class/$method/{$this->subject_user_info['user_id']}/{$this->interval}/{$this->time_of_begin}/{$this->time_of_rander}/";
		}else{
		
			$request_uri = $server_base_uri . "/api/$class/$method/{$this->subject_user_info['user_id']}";
		}
		return $this->oauth_client->request( $request_uri , TRUE );
	}/*}}}*/

	//得到每页的页首信息
	private function get_pager_top(){
	/*{{{*/	
		 $this->load->library( 'report_factory' );
		 $user_info = json_decode( $this->get_info( 'account' , 'basic' ) , TRUE );

		 //@todo 缓存之
		 return $this->report_factory->create_cell(
			 '{"top_info":"ABC商业数据报告概述 SUMMARY" , 
			 "describe_info":"数据报告服务始终致力于构建一个清晰的商业架构。瞬息万变的商业世界需要你迅速做出卓有成效的操作和决策，从而获取商业优势。ABC数据报告提供即时、准确的数据，你可以随时获取最新的数据，跟踪最新发生的数据流变化，可以轻易获取您最关心的核心数据，进行一系列动态监测，通过数据和趋势驱动最终的商业行为。您的商业表现取决于您的能力，比如多维度的管理能力，复杂的商业手法以及基于市场的一贯性思维，数据报告可以帮助您开发最卓有成效的商业战略，并且无论你走到哪里，都拥有获取完整数据报告的权利。",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"bin margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"账户信息" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":{
					"开放平台":"dazery.com",
					"用户名":"' . $user_info['user_nick'] . '",
					"ID":"' . $user_info['sys_domain'] .'",
					"默认域名":"' . $user_info['sys_domain'] . '",
					"个性域名":"' . $user_info['domain'] . '",
					"简介":"' . $user_info['describe'] . '",
					"所在城市":"' . $user_info['loc_city'] . '"
			 },
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"关联信息" , 
			 "describe_info":"version santiago 1.0",
			 "headline_info":{"big_number":"' . $this->interval . '","adj":"天"},
			 "key_value_info":{
				 "起始日期":"' . $this->time_of_begin_format . '",
				 "截至日期":"' . $this->time_of_rander_format . '",
				 "下轮报告获取时间":"' . $this->next_time_of_rander . '"
			 },
			 "other_class":"single"}'
		 );
	}/*}}}*/

	public function basic(){
	/*{{{*/
		 $this->load->library( 'report_factory' );

		 //获得用户基本信息
		 $user_info = json_decode( $this->get_info( 'account' , 'basic' ) , TRUE );
		 //获得用户 sns , 方案数量信息 Total
		 $user_counts_total = json_decode( $this->get_info( 'account' , 'counts' ) , TRUE );
		 //获得用户 sns , 方案数量信息 Month
		 //首次设置时间间隔 此处必须为数字 
		 $user_counts_month = json_decode( $this->get_info( 'account' , 'counts' , 30 ) , TRUE );

		 //获得用户的交易信息
		 $user_tran_total = json_decode( $this->get_info( 'transaction' , 'sum_of_transaction_count' ) , TRUE );
		 //获得用户的交易信息
		 $user_tran_month = json_decode( $this->get_info( 'transaction' , 'sum_of_transaction_count' , $this->interval ) , TRUE );

		 //获得用户购买信息
		 $user_tran_buyer_count_month = json_decode( $this->get_info( 'transaction' , 'sum_of_transaction_count' , $this->interval ) , TRUE );
		 $user_tran_paid_count_month = json_decode( $this->get_info( 'transaction' , 'paid_count' , $this->interval ) , TRUE );

		 //计算粉丝方案比
		 $rate_of_rev_contacts_count_and_solution_count = round( $user_counts_total['rev_contacts_count'] / $user_counts_total['solution_count'] , 2 );

		 //获得商品之最
		 $most_paid_month = json_decode( $this->get_info( 'transaction' , 'most_paid' , $this->interval ) , TRUE );
		 $most_bought_month = json_decode( $this->get_info( 'transaction' , 'most_bought' , $this->interval ) , TRUE );

		 //page 1
		 /*{{{*/
		 $rows[] = 'SPLIT';
		 $rows[] = $this->get_pager_top();
		 $rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"关注 Total" , 
			 "describe_info":"截止 ' . $this->time_of_rander_format . ' 该账户共关注' . $user_counts_total['contacts_count'] . '个用户",
			 "headline_info":{"big_number":"' . $user_counts_total['contacts_count'] . '","adj":"人"},
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"粉丝 Total" , 
			 "describe_info":"截止 ' . $this->time_of_rander_format . ' 该账户共有粉丝' . $user_counts_total['rev_contacts_count'] . '个",
			 "headline_info":{"big_number":"' . $user_counts_total['rev_contacts_count'] . '","adj":"人"},
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"方案 Total" , 
			 "describe_info":"截止 ' . $this->time_of_rander_format . ' 该账户共发布方案' . $user_counts_total['solution_count'] . '个",
			 "headline_info":{"big_number":"' . $user_counts_total['solution_count'] . '","adj":"个"},
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"粉丝方案比 Total" , 
			 "describe_info":"截止 ' .  $this->time_of_rander_format . ' 该账户粉丝方案比' .
				  $rate_of_rev_contacts_count_and_solution_count . '<br />每发布一个方案将平均获得' .
				  $rate_of_rev_contacts_count_and_solution_count . '个新用户的关注",
			 "headline_info":{"big_number":"' . $rate_of_rev_contacts_count_and_solution_count . '","adj":""},
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"粉丝 Month" , 
			 "describe_info":"本月度获得新粉丝' . 
				 $user_counts_month['rev_contacts_count'] . '个<br />日均获得新粉丝' . round( $user_counts_month['rev_contacts_count'] / 30 , 2 ). '个",
			 "headline_info":{"big_number":"' . $user_counts_month['rev_contacts_count'] . '","adj":""},
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"营业额 Month" , 
			 "describe_info":"本月度 实际营业额￥' . 
				 $user_tran_total['sum_of_transaction_count'] . '元<br />日均 营业额￥' . round( $user_tran_total['sum_of_transaction_count'] / 30 , 2 ) . '元",
			 "headline_info":{"big_number":"' . $user_tran_total['sum_of_transaction_count'] . '","adj":""},
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"购买次数 Month" , 
			 "describe_info":"本月度 粉丝购买次数' . $user_tran_buyer_count_month['sum_of_transaction_count_follower'] . 
				 '次<br />日均粉丝购买次数' . round( $user_tran_buyer_count_month['sum_of_transaction_count_follower'] / 30 , 2 ) . '次",
			 "headline_info":{"big_number":"' . $user_tran_buyer_count_month['sum_of_transaction_count_follower'] . '","adj":""},
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付次数 Month" , 
			 "describe_info":"本月度粉丝支付次数' . $user_tran_paid_count_month['paid_count_follower'] . 
				 '次<br />日均粉丝支付次数' . round( $user_tran_paid_count_month['paid_count_follower'] / 30 , 2 ) . '",
			 "headline_info":{"big_number":"' . $user_tran_paid_count_month['paid_count_follower'] . '","adj":""},
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell(
			 '{"top_info":"购买最多 Month" , 
			 "describe_info":"本月度 方案购买次数最多' . $most_bought_month['bought_count'] . '次",
			 "headline_info":{"big_number":"' . $most_bought_month['bought_count'] . '","adj":""},
			 "key_value_info":"",
			 "other_class":"bin margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付最多 Month" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"bin"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买时间分布" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"支付时间分布" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );/*}}}*/

		 //pager 2
		 /*{{{*/
		 $rows[] = 'SPLIT';
		 $rows[] = $this->get_pager_top();
		 $rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"购买人数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"人均购买次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"人均购买金额" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"支付次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付人数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"购买总金额" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付总金额" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买高峰时段 Total" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"购买时间分布" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"支付高峰时段" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付时间分布" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );/*}}}*/

		 //pager 3
		 /*{{{*/
		 $rows[] = 'SPLIT';
		 $rows[] = $this->get_pager_top();
		 $rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"方案平均价格" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"方案平均折扣" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"方案平均购买次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"方案平均购买人数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"方案平均支付次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"方案平均支付人数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"价格最低的方案" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"价格最高的方案" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"折扣最低的方案" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"折扣最高的方案" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );/*}}}*/

		 //pager 4
		 /*{{{*/
		 $rows[] = 'SPLIT';
		 $rows[] = $this->get_pager_top();
		 $rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买次数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"购买次数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买次数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"购买次数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买人数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"购买人数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买人数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"购买人数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );/*}}}*/

		 //pager 5
		 /*{{{*/
		 $rows[] = 'SPLIT';
		 $rows[] = $this->get_pager_top();
		 $rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"支付次数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"支付次数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"支付次数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付次数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"支付人数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付人数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"支付人数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"支付人数排名" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );/*}}}*/
		 
		 //pager 6
		 /*{{{*/
		 $rows[] = 'SPLIT';
		 $rows[] = $this->get_pager_top();
		 $rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"粉丝" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"方案" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"粉丝方案比" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"粉丝方案比 Total" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"购买人数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"人均购买次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"人均购买金额" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"支付次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付人数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"人均支付次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"人均支付金额" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买时间分布" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"支付时间分布" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );/*}}}*/

		 //pager 7
		 /*{{{*/
		 $rows[] = 'SPLIT';
		 $rows[] = $this->get_pager_top();
		 $rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"购买人数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"人均购买次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"人均购买金额" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"支付次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付人数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"人均支付次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"人均支付金额" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"支付率" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"客户进化率" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"购买总金额" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付总金额" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );
		 
		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买高峰时段" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"购买时间分布" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付高峰时段" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付时间分布" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );/*}}}*/

		 //pager 8
		 /*{{{*/
		 $rows[] = 'SPLIT';
		 $rows[] = $this->get_pager_top();
		 $rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"关注 Total" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"粉丝 Total" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"方案 Total" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"粉丝方案比 Total" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"粉丝" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付总金额" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"购买次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付次数" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 );

		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买最多" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ). $this->report_factory->create_cell( 
			 '{"top_info":"支付最多" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );
		 
		$rows[] = $this->report_factory->create_cell( 
			 '{"top_info":"购买时间分布" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"支付时间分布" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single margin_right"}'
		 ) . $this->report_factory->create_cell( 
			 '{"top_info":"&nbsp" , 
			 "describe_info":"",
			 "headline_info":"",
			 "key_value_info":"",
			 "other_class":"single"}'
		 );/*}}}*/
		 $this->load->view( 'report/report' , array( 'rows'=>$rows ) );
	}
	public function professional(){}
	public function ultimate(){}
}
?>
